﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace BookStore.Solution.Utilities
{
    public class CheckValidated
    {
        public static bool CheckValidatedEmail(string Email)
        {
            string[] email = Email.Split('@');
            if (email.Length != 2)
                return false;
            if (email[1][0] == '.')
                return false;
            int countDos = 0;
            for (int i = 0; i < email[1].Length; i++)
            {
                if (email[1][i] == '.' && email[1][i + 1] == '.')
                    return false;
                if (email[1][i] == '.')
                    countDos++;
            }
            if (countDos > 0)
                return true;
            return false;
        }
    }
}
